﻿@model Ymca.Web.Models.Blog.CreatePostViewModel

<h2>Create Post</h2>

@using (Html.BeginForm("Create", "Blog", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
	@Html.ValidationSummary(true)
	<div class="control-group">
		<label class="control-label" for="Title">Title</label>
		<div class="controls">
			@Html.TextBoxFor(model => model.Title, new { placeholder = "User name" })
			@Html.ValidationMessageFor(model => model.Title, null, new { @class = "text-error" })
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label" for="Body">Body</label>
		<div class="controls">
			@Html.TextAreaFor(model => model.Body, new { placeholder = "Password" })
			@Html.ValidationMessageFor(model => model.Body, null, new { @class = "text-error" })
			<script>
				CKEDITOR.replace('Body');
            </script>
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label" for="Attachments">Attachments</label>
		<div class="controls">
			@Html.TextBoxFor(model => model.Attachments, new { type = "file", multiple = "multiple" })
			@Html.ValidationMessageFor(model => model.Attachments, null, new { @class = "text=error" })
		</div>
	</div>
	
	<p>
		<input type="submit" class="btn btn-success" value="Create" />
		<a href="@Url.Action("Index")" class="btn">Back</a>
	</p>
}
